<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7">

<script type="text/javascript" src="<%=request.getContextPath()%>/include/styleBase/js/jquery.js"></script>
<title>创建相册</title>
</head>

<%
String personuuid = request.getAttribute("personuuid")==null?"":request.getAttribute("personuuid").toString();
%>

<body>
<form name="frm">
	<table border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" width="100%">
    
    <tr>
      <td height="30">创建相册
      <input type="hidden" name="ALB_PA_TYPE" id="ALB_PA_TYPE" value="1" /><!--个人相册-->
      <input type="hidden" name="ALB_PA_PERSONUUID" id="ALB_PA_PERSONUUID" value="<%=personuuid%>" />
      </td>
    </tr>
    <tr>
    	<td height="30">
        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" width="100%">
        
        <tr>
        	<td width="100%" align="center">
            <table border="0" cellpadding="0" cellspacing="0" width="90%">
            <tr>
            	<td height="35" align="center">相册名称：</td>
                <td height="35" align="left"><input type="text" size="50" id="ALB_PA_NAME" name="ALB_PA_NAME"/></td>
            </tr>
            <tr>
            	<td height="30" align="center">相册说明：</td>
                <td height="30" align="left"><textarea cols="50" rows="3" id="ALB_PA_MEMO" name="ALB_PA_MEMO"></textarea></td>
            </tr>
            <tr>
            	<td height="35" align="center">谁能访问：</td>
                <td height="35" align="left">
                	<input type="radio" id="ALB_PA_VIEWLIMIT" name="ALB_PA_VIEWLIMIT" value="1" checked="checked" />所有人&nbsp;&nbsp;
                    <input type="radio" id="ALB_PA_VIEWLIMIT" name="ALB_PA_VIEWLIMIT" value="2" />好友&nbsp;&nbsp;
                    <input type="radio" id="ALB_PA_VIEWLIMIT" name="ALB_PA_VIEWLIMIT" value="0" />仅限您自己&nbsp;&nbsp;
                </td>
            </tr>
            <tr>
            	<td height="35" align="center">评论权限：</td>
                <td height="35" align="left">
                	<input type="radio" id="ALB_PA_DISCUSSLIMIT" name="ALB_PA_DISCUSSLIMIT" value="1" checked="checked" />所有人&nbsp;&nbsp;
                    <input type="radio" id="ALB_PA_DISCUSSLIMIT" name="ALB_PA_DISCUSSLIMIT" value="2" />好友&nbsp;&nbsp;
                    <input type="radio" id="ALB_PA_DISCUSSLIMIT" name="ALB_PA_DISCUSSLIMIT" value="9" />不允许评论&nbsp;&nbsp;
                </td>
            </tr>
                
            </table>
            </td>
        </tr>
        
        </table>
        </td>
    </tr>
    
    </table>
    
    <br />
    <div align="center">
    <input type="button" name="createalbum" value="确定" onclick="_createalbum();" />&nbsp;
    <input type="button" name="actioncancel" value="取消" onclick="_cancel();" />
    </div>
    
</form>
</body>
</html>

    <script language="javascript">
	function popUp(){
			J('#createalbum').dialog({ id: 'd1', title: '创建相册', cover:true,page: '<%=request.getContextPath()%>/article/articlelist?method=ourBlog', link: true, btns: false, width: 700, height: 450 }); 
	}
	
	function _createalbum(){
		var patype = $("#ALB_PA_TYPE").val();
		var papersonuuid = $("#ALB_PA_PERSONUUID").val();
		var paname = $("#ALB_PA_NAME").val();
		var pamemo = $("#ALB_PA_MEMO").val();
		var paviewlimit = $("#ALB_PA_VIEWLIMIT").val();
		var padiscusslimit = $("#ALB_PA_DISCUSSLIMIT").val();
		alert(paname);
		$.ajax({
		type: "POST", 
		url: '<%=request.getContextPath()%>/album?method=albumCreate',
		data:{ALB_PA_TYPE:patype,ALB_PA_PERSONUUID:papersonuuid,ALB_PA_NAME:paname,ALB_PA_MEMO:pamemo,ALB_PA_VIEWLIMIT:paviewlimit,ALB_PA_DISCUSSLIMIT:padiscusslimit},
		
		error:function(){alert("与服务器失去联系，请刷新本页面后再重试！");},
		success: function(msg){
			alert("相册创建成功！");
			window.close();
			window.opener.reload();
			}
		});
	}

	</script>